<template>
<div>
    <h2>欢迎登录</h2>
    用户名：<input type="text" v-model:value="username"  /> <br />
	密码：<input type="text" v-model:value="password"  /> <br />
    <button type="button" @click="login()">登录</button><br />

</div>

</template>

<script>
export default {
  
    data(){
        return{
            username:"",
            password:"",

        }
    },
    methods:{
        
        login(){
            let user = new Object();
            user.username = this.username;
            user.password = this.password;
            this.$axios.post("login",user).then((response) => {
                if(response.data.flag == true){
                    this.$router.push("/ChatRoom/"+response.data.message);
                }
            });


        }

    }

}
</script>

<style>

</style>